#!/usr/local/bin/env python3.7
# from  numba import jit
# import req
import tkinter
from PIL import Image,ImageTk
# import tkinter.messagebox 
# root = tk.Tk()
# img = req.yanzhengma
#这个是消息框。对话框的关键
# tkinter.messagebox.showinfo('请输入验证码','jkj')
# tkinter.messagebox.showwarning('请输入验证码','jdkjfhk')
# 初始化
# @jit
def main():
    window = tkinter.Tk()
    # 标题
    window.title('请输入验证码')
    # 长 宽
    x = 500
    y = 300
    # 获取屏幕尺寸计算布局，使窗口居中
    screenwidth = window.winfo_screenwidth()
    screenheight = window.winfo_screenheight()
    alignstr = '%dx%d+%d+%d' % (x, y, (screenwidth-x)/2, (screenheight-y)/2)
    # 绘制窗口
    window.geometry(alignstr)
    # 处理图片
    ima_ge = Image.open('ls.jpg')
    image_file = ImageTk.PhotoImage(ima_ge)
    # 显示图片
    imLal = tkinter.Label(window,image=image_file).pack()
    # 显示输入框
    w = tkinter.Entry(window,width=50,fg='black')
    w.pack()
    # 显示确认按钮
    o  =  tkinter.Button(window,text='确认').pack()
    # image = canvas.create_image(90,43,anchor='n',image=image_file)
    window.mainloop()
if  __name__ == "__main__":
    main()
